<script>

function login()
{
	habilitaMenu();

	$("#first_div").animate({marginLeft: -520}, 500);
	$("#second_div").fadeIn();

	$("#user_name").html("<b>" + user.caf01_user + "</b>").fadeIn();

	if(user.caf01_admin == "1")
	{
		$(".stoq").show();
		$(".relat").show();
	}
	else
	{
		$(".relat").hide();
	}
}

function changeLng(lng)
{
	//$.ajax(function)
}

function logoff()
{
	desabilitaMenu();

	$("#menu_logoff").css("background", "#EF9200");
	
	user = false;

	$("#user_name").html("").fadeOut();
}

$(function(){
	if(user)
	{
		$("#nameUser").css('background-color', "#009900").html(user.caf01_user);

		$("#first_div").animate({marginLeft: -520}, 500);
		$("#second_div").fadeIn();

		$(".user_name").html($("#user_name").html());
	}
});

</script>

<div id="first_div" style="position: fixed; width: 380px; left: 50%; margin-left: -160px;">
	<?php echo $this->partial("helpers/password.phtml", array("jsfunc" => "login()", "base" => $this->base)); ?>
</div>
<div id="second_div" class="ui-corner-all" style="background-image: url('<?php echo $this->base; ?>/public/images/waiter.png'); background-repeat: no-repeat; background-position: 100% 110%; border: 1px solid gray; position: fixed; height: 404px; background-color: white; display: none; width: 700px; left: 50%; margin-left: -100px;">
	<div class="ui-corner-top" style="padding: 10px; color: white; font-size: 19px; background: #FF9900;">
		Bem Vindo
	</div>
	<div style="margin-bottom: 10px; height: 10px;">
		<div>
			<table>
				<tr>
					<td colspan="2">
						<img src="<?php echo $this->base; ?>/public/images/logo/projecttus.png" />
					</td>
				</tr>
				<tr>
					<td>
						Telefone
					</td>
					<td>
						(41)3545-2366
					</td>
				</tr>
				<tr>
					<td>
						Tele-Entrega
					</td>
					<td>
						(41)3545-2366
					</td>
				</tr>
			</table>
			<div style="padding: 3px;">
				<hr style="margin-top: 5px; margin-bottom: 5px;" />
				<a href="#">Suporte Sistema</a>
				<br />
				Telefone: (41)3333-3333			
			</div>
		</div>
		<div style="float: left; width: 300px; margin-top: 3px;">
			<label id='load_subproduct' style='display: none;'>&nbsp;<img src='$this->base/public/images/ajax-loader.gif' /></label>
		</div>
	</div>
</div>